
/*
 * @Description: In User Settings Edit
 * @Author:zhanghao
 * @Date: 2019-10-11 14:15:09
 * @LastEditTime: 2019-10-11 14:59:54
 * @LastEditors: Please set LastEditors
 */
function func1(){
    func2()
}
async function func2(){
    try{
       await func3()
    }catch(error){
        console.log("error")
    }
}

function func3(){
    return new Promise((resolve,reject)=>{
        setTimeout(function(){
            const r = Math.random();
            if(r<0.5){
                reject('error')
            }
        },2000)
    })    
}

func2();